package com.dark;

import com.alibaba.fastjson.JSON;
import org.apache.log4j.Logger;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

/**
 * Hello world!
 * 写入日志中，然后使用kafka log4j工具包进行发送
 *
 */
public class  App {
    private static final Logger LOGGER = Logger.getLogger(App.class);
    public static void main(String[] args) throws InterruptedException {
        DataVo dataVo;
        String id= UUID.randomUUID().toString();
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss");
        for (int i = 0; i < 20; i++) {
            dataVo=new DataVo();
            dataVo.setId(id);
            dataVo.setData(i);
            dataVo.setTime(sdf.format(new Date()));
            LOGGER.info(JSON.toJSONString(dataVo));
            Thread.sleep(1000);
        }
    }
}
